#! /bin/sh

set -eu

scriptdir="$( cd "$( dirname "$0" )" && pwd )"
to=$(readlink -f ./support/timeout)

t="$(readlink -f $1)"
run="$t"
if test -d "$t"
then
  run="$t/run"
fi

export TEST_CASE="$t"
workingdir="$(mktemp -d)"

cd "$workingdir"

set +e
$to 60 "$run"
rc="$?"
set -e

rm -r "$workingdir"

exit "$rc"
